package org.ziwei.rule;

import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.ziwei.rule.dao.BookRepository;
import org.ziwei.rule.pojo.Book;

@SpringBootApplication
public class Application {

	public static void main(String[] args) {
		SpringApplication.run(Application.class);
	}

	@Bean
	public CommandLineRunner demo(BookRepository repository) {
		return (args) -> {
			Iterable<Book> books = repository.findAll();
			for (Book book : books) {
				System.out.println(book);
			}
		};
	}

}